package entity

import (
	"time"

	"gorm.io/gorm"
	"shqsoft.cn/pas3ui/base"
)

//IndiLoanFlowChUpdate
type IndiLoanFlowChUpdate struct {
	ACID         int             `gorm:"column:ACID;primary_key;"`
	CUID         int             `gorm:"column:CUID"`
	CUNM         string          `gorm:"column:CUNM"`
	IDNO         string          `gorm:"column:IDNO"`
	EVNO         string          `gorm:"column:EVNO"`
	LAKD         string          `gorm:"column:LAKD"`
	UTNM         string          `gorm:"column:UTNM"`
	Releasedate  time.Time       `gorm:"column:releasedate"`
	Maturitydate time.Time       `gorm:"column:maturitydate"`
	ACBL         float64         `gorm:"column:ACBL"`
	Bgqdivi      []base.DiviDesc `gorm:"-" json:"Bgqdivi"`
}

//TableName
func (IndiLoanFlowChUpdate) TableName() string {
	return "V_INDI_LOAN_FLOW_UPDATE"
}

// AfterFind 查询后触发器
func (i *IndiLoanFlowChUpdate) AfterFind(tx *gorm.DB) (err error) {
	d, err := base.GetDiviMap(base.IndiLoan, i.ACID)
	if err != nil {
		return err
	}
	i.Bgqdivi, err = d.GetDesc()
	return
}
func IndiLoanFlowChUpdateEF() base.EntityFunc {
	return func() interface{} {
		entity := IndiLoanFlowChUpdate{}
		return &entity
	}
}
func IndiLoanFlowChUpdateESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []IndiLoanFlowChUpdate
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("IndiLoanFlowChUpdate", base.NewDefaultDao(IndiLoanFlowChUpdateEF(), IndiLoanFlowChUpdateESF(), nil, "ch"))
}
